package net.xxcl.exam.service;

import java.util.List;
import net.xxcl.exam.mapper.AnswerMapper;
import net.xxcl.exam.pojo.Answer;
import net.xxcl.exam.pojo.Criteria;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional()
public class AnswerService {
    @Autowired
    private AnswerMapper answerMapper;

    private static final Logger logger = LoggerFactory.getLogger(AnswerService.class);

    @Transactional(readOnly = true)
    public int countByExample(Criteria example) {
        int count = this.answerMapper.countByExample(example);
        logger.debug("count: {}", count);
        return count;
    }

    @Transactional(readOnly = true)
    public Answer selectByPrimaryKey(Integer id) {
        return this.answerMapper.selectByPrimaryKey(id);
    }

    @Transactional(readOnly = true)
    public List<Answer> selectByExample(Criteria example) {
        return this.answerMapper.selectByExample(example);
    }

    public int deleteByPrimaryKey(Integer id) {
        return this.answerMapper.deleteByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(Answer record) {
        return this.answerMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(Answer record) {
        return this.answerMapper.updateByPrimaryKey(record);
    }

    public int deleteByExample(Criteria example) {
        return this.answerMapper.deleteByExample(example);
    }

    public int updateByExampleSelective(Answer record, Criteria example) {
        return this.answerMapper.updateByExampleSelective(record, example);
    }

    public int updateByExample(Answer record, Criteria example) {
        return this.answerMapper.updateByExample(record, example);
    }

    public int insert(Answer record) {
        return this.answerMapper.insert(record);
    }

    public int insertSelective(Answer record) {
        return this.answerMapper.insertSelective(record);
    }
}